
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.ArrangeResultDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class ArrangeResultDaoJdbc extends BaseDaoJdbc implements ArrangeResultDao {
	String tableName="T_ARRANGE_RESULT";
	String beanName="arrangeResult";
	
	public CommonBean createArrangeResult(){
		CommonBean arrangeResults=this.createBean(tableName,beanName);
                return arrangeResults;		
	}
	
/*
	public CommonBean findArrangeResults(String refid) {
		CommonBean arrangeResults=this.createArrangeResult();
		String sql="select * from T_ARRANGE_RESULT where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		arrangeResults.addData(data);
                return arrangeResults;
       }
*/
	public CommonBean findArrangeResultById(String id) {
		CommonBean arrangeResults=this.createArrangeResult();
		String sql="select * from T_ARRANGE_RESULT where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		arrangeResults.addData(data);
    return arrangeResults;
  }
  
	public CommonBean findAllArrangeResults() {
		CommonBean arrangeResults=this.createArrangeResult();
		String sql="select * from T_ARRANGE_RESULT ";
		List data=this.getCommonDao().select(sql,new String[]{});
		arrangeResults.addData(data);
    return arrangeResults;
  }
	public void insertArrangeResult(CommonBean arrangeResultBean){
		List data=arrangeResultBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
}

